package com.smyh.model.host.record;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * Created by Administrator on 2016/8/16.
 */
public class HostSyncRecordModel {
    /**
     * 数据模型：
     * 同步电流
     * 第一层：key-设备地址
     * 第二层：key-组号，第三层：key-相别：1-A、2-B、3-C、4-0
     * 第四层：key-时间目录，第五层：value-波形数据
     */
    public static Map<String,Map<Integer,Map<Integer,Map<Integer,List<Integer>>>>> syncElectMapModel = new HashMap<>();

    public static void putSyncElecMapModel(String RF_addr,Integer groupNum,Integer phaseNum,Integer timeIndex,List dataList){
        Map<Integer,Map<Integer,Map<Integer,List<Integer>>>> scondMap = syncElectMapModel.get(RF_addr);
        if(scondMap == null){
            scondMap = new HashMap<>();
            syncElectMapModel.put(RF_addr,scondMap);
        }
        Map<Integer,Map<Integer,List<Integer>>> thirdMap = scondMap.get(groupNum);
        if(thirdMap == null){
            thirdMap = new HashMap<>();
            scondMap.put(groupNum,thirdMap);
        }
        Map<Integer,List<Integer>> forthMap = thirdMap.get(phaseNum);
        if(forthMap == null){
            forthMap = new HashMap<>();
            thirdMap.put(groupNum,forthMap);
        }
        forthMap.put(timeIndex,dataList);


    };

    /**
     * 数据模型：
     * 同步电压
     * 第一层：key-设备地址
     * 第二层：key-组号，第三层：key-相别：1-A、2-B、3-C、4-0
     * 第四层：key-时间目录，第五层：value-波形数据
     */
    public static Map<String,Map<Integer,Map<Integer,Map<Integer,List<Integer>>>>> syncVoltMapModel = new HashMap<>();

    public static void putSyncVoltMapModel(String RF_addr,Integer groupNum,Integer phaseNum,Integer timeIndex,List dataList){
        Map<Integer,Map<Integer,Map<Integer,List<Integer>>>> scondMap = syncVoltMapModel.get(RF_addr);
        if(scondMap == null){
            scondMap = new HashMap<>();
            syncElectMapModel.put(RF_addr,scondMap);
        }
        Map<Integer,Map<Integer,List<Integer>>> thirdMap = scondMap.get(groupNum);
        if(thirdMap == null){
            thirdMap = new HashMap<>();
            scondMap.put(groupNum,thirdMap);
        }
        Map<Integer,List<Integer>> forthMap = thirdMap.get(phaseNum);
        if(forthMap == null){
            forthMap = new HashMap<>();
            thirdMap.put(groupNum,forthMap);
        }
        forthMap.put(timeIndex,dataList);
    };

    /**
     * 同步录波时间目录：两个时间
     */
    public static List<Long> contentsSyncTimes = new ArrayList<>();

}
